<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button id="btn">123</button>
<script>
    var btn = document.getElementById('btn');
    btn.onclick = function () {
        alert('已选中');
    }
</script>
</body>
</html>